package kr.saeildamil.androidstudy_second26;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class WordDBHelper extends SQLiteOpenHelper {
	final static String TAG="WordDBHelper";
	
	public WordDBHelper(Context context) {
		super(context, "EngWord.db", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		Log.d(TAG, "onCreate(SQLiteDatabase)");
		String sql="CREATE TABLE dic(_id INTEGER PRIMARY KEY AUTOINCREMENT,"+"eng TEXT,han TEXT);";
		db.execSQL(sql);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldversion, int newversion) {
		Log.d(TAG, "onUpgrade(SQLiteDatabase)");
		String sql="DROP TABLE IF EXISTS dic";
		db.execSQL(sql);
		onCreate(db);
	}

}
